package TestsBuxfer;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

/**
 * Created with IntelliJ IDEA.
 * User: C13T
 * Date: 12.07.13
 * Time: 19:15
 * To change this template use File | Settings | File Templates.
 */
public class LoginPage {
    public WebDriver driver;


        public LoginPage(WebDriver driver){
        this.driver = driver;
    }

        public LoginPage login(){
            //ByValidCred (){
            //open site www.buxfer.com
            driver.get("https://www.buxfer.com/");
            driver.manage().window().maximize(); //maximize the browser window to make all the items are visible
            //navigate to login page and check whether it is opened
            WebElement LoginButton = driver.findElement(By.linkText("Login"));
            LoginButton.click();
            //driver.manage().timeouts().implicitlyWait(105, TimeUnit.SECONDS);


            // The login page contains some HTML elements that will be represented as WebElements.
            WebElement UserNameField = driver.findElement(By.id("login_username"));
            UserNameField.sendKeys("mighaylova@gmail.com");
            WebElement PassWordField = driver.findElement(By.id("login_password"));
            PassWordField.sendKeys("7284838");
           //WebElement LoginButton1 = driver.findElement(By.cssSelector("a"));
            WebElement LoginButton1 = driver.findElement(By.linkText("Login"));
            LoginButton1.click();

        return new LoginPage (driver);
        }


}
